feat: add distributed Streamable HTTP event store#1024
Merged
Conversation
DaleSeo
force-pushed
the
agent/distributed-event-store
branch
2 times, most recently
from
July 22, 2026 17:57
bde88eb to
4321381
Compare
DaleSeo
marked this pull request as ready for review
July 22, 2026 18:26
DaleSeo
force-pushed
the
agent/distributed-event-store
branch
from
July 22, 2026 22:46
4321381 to
0a103b4
Compare
alexhancock
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #330
Motivation and Context
The load-balancing problem described in #330 has largely been addressed by stateless operation, the removal of sessions from the latest protocol lifecycle, and
SessionStore-based restoration for legacy sessions. Stateless operation removes most cross-instance session routing, but it does not preserve an in-flight SSE response when the original connection or server instance disappears.This PR closes that remaining gap with a shared
EventStore. Event IDs are globally unique and identify their stream without a session ID, so another server instance can replay missed events fromLast-Event-ID. Stateless handlers continue writing their response to the shared store after the original HTTP connection is dropped, and the client can reconnect withoutMcp-Session-Id. Legacy session-based replay continues to use the same event-store contract.How Has This Been Tested?
Breaking Changes
StreamableHttpClient::get_streamandget_stream_with_max_sse_event_sizenow receiveOption<Arc<str>>for the session ID. Custom HTTP client implementations must handleNonefor stateless replay.LocalSessionManagerandNeverSessionManagerno longer implementUnwindSafeorRefUnwindSafebecause they contain an optionalArc<dyn EventStore>. Code that captures either manager acrossstd::panic::catch_unwindmust provide its own assertion or avoid that boundary.Types of changes
Checklist